package com.company.myfirstjmixproject.entity.enums;

import io.jmix.core.metamodel.datatype.impl.EnumClass;

import javax.annotation.Nullable;


public enum StateEnum implements EnumClass<String> {

    /**
     * 生效
     */
    ACTIVE("Active"),

    /**
     * 失效
     */
    Inactive("Inactive");

    private String id;

    StateEnum(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

    @Nullable
    public static StateEnum fromId(String id) {
        for (StateEnum at : StateEnum.values()) {
            if (at.getId().equals(id)) {
                return at;
            }
        }
        return null;
    }
}